<template>
	<view class="Global">
		<!-- <image class="imagepage" src="/static/background@2x.png" mode=""></image> -->

		<!-- <bgImage></bgImage> -->
		<image class="imagepage" src="/static/bg.jpg" mode=""></image>

		<MyNav :title="title" bgColor="" :backIcon="isback" id="main" :textColor="titleColor"></MyNav>
		<!-- 头部 -->

		<scroll-view scroll-y="true" class="Content" :style="'height:'+scrollViewHeight+'px'">
			<view class="ContentInner">

				<view class="contentTop">
					<picker mode="selector" :value="storeName" :range="StoreList" range-key="name"
						@change="chooseHobby">
						<view class="contentTopLeft">
							<text class="contentTopLeftText">{{storeName}}</text>
							<!-- <uni-icons class="infoArrow" type="bottom" size="12"></uni-icons> -->
						</view>
					</picker>

					<view class="contentTopRight">
						<view class="contentTopRightLeft" @click="qrCode()">
							<image class="contentTopRightLeftImg" src="/static/index/erweima.png" mode="widthFix">
							</image>
						</view>
						<view class="contentTopRightLeft" @click="noticeClick()">
							<image class="contentTopRightLeftImg" src="/static/index/xiaoxi.png" mode="widthFix">
							</image>
						</view>
					</view>

				</view>
				<!-- 头部 -->


				<!-- 头部信息栏 -->
				<view class="contentTopInfo">
					<!-- 上半部分 -->
					<image class="contentTopInfoTopImgBg" src="/static/index/shouru_beijing.png" mode=""></image>
					<view class="contentTopInfoTop">

						<view class="contentTopInfoTopLeft">

							<view class="contentTopInfoTopLeftTop">
								<text class="contentTopInfoTopLeftTopText" v-if="userInfo.userType=='01'">今天完成(件)</text>
								<text class="contentTopInfoTopLeftTopText" v-if="userInfo.userType=='02'">今天收入(元)</text>
								<image class="contentTopInfoTopLeftTopImg" src="/static/index/kejian.png"
									mode="widthFix">
								</image>
							</view>

							<text class="contentTopInfoTopLeftBottom">{{userSalary.todaySum}}</text>

						</view>


						<view class="contentTopInfoRight" @click="salaryUrl()">

							<text class="contentTopInfoRightText">薪资明细</text>
							<image class="contentTopInfoRightImg" src="/static/index/you_jiantou.png" mode=""></image>
						</view>
					</view>
					<!-- 上半部分 -->

					<!-- 下半部分开始 -->
					<view class="contentTopDown">

						<view class="contentTopDownTop">
							<text class="contentTopDownTopText" v-if="userInfo.userType=='01'">昨天完成(件)</text>
							<text class="contentTopDownTopText" v-if="userInfo.userType=='02'">昨天收入(元)</text>
							<text class="contentTopDownTopText" v-if="userInfo.userType=='01'">本月完成(件)</text>
							<text class="contentTopDownTopText" v-if="userInfo.userType=='02'">本月收入(元)</text>
							<!--							<text class="contentTopDownTopText">上月收入(元)</text>-->
						</view>

						<view class="contentTopDownBottom">
							<text class="contentTopDownBottomText">{{userSalary.yesterdaySum}}</text>
							<text class="contentTopDownBottomText">{{userSalary.monthSum}}</text>
							<!--							<text class="contentTopDownBottomText">{{userSalary.lastMonthSum}}</text>-->
						</view>




					</view>
					<!-- 下半部分结束 -->



				</view>
				<!-- 头部信息栏 -->



				<!-- 中间部分  userInfo.userType=='01' 表示老板 userType = 01老板  02 员工 -->
				<view class="contentCenter" v-if="userInfo.userType=='01'">

					<!-- 左边部分 -->
					<view class="contentCenterLeft">
						<!-- 上部分 -->
						<view class="contentCenterLeftTop" @click="goWaitUrl">

							<view class="contentCenterLeftTopLeft">
								<text class="contentCenterLeftTopLeftText">待办订单</text>
								<text class="contentCenterLeftTopLeftTextValue">{{orderInfo.allCount}}</text>
							</view>
							<view class="contentCenterLeftTopRight">
								<image class="contentCenterLeftTopRightImg" src="/static/index/daiban_gongdan.png"
									mode="">
								</image>
							</view>
						</view>
						<!-- 上部分 -->
						<!-- 下部分 -->
						<view class="contentCenterLeftBottom">

							<view class="contentCenterLeftBottomTop">
								<text class="contentCenterLeftBottomTopText">
									已完成工单
								</text>
							</view>

							<view class="contentCenterLeftBottomBottom">

								<view class="contentCenterLeftBottomBottomTop">
									<text class="contentCenterLeftBottomBottomTopText">今天完成</text>
									<text class="contentCenterLeftBottomBottomTopText">昨天完成</text>
								</view>

								<view class="contentCenterLeftBottomBottomBottom">
									<text
										class="contentCenterLeftBottomBottomBottomText">{{orderInfo.todayCount}}</text>
									<text
										class="contentCenterLeftBottomBottomBottomText">{{orderInfo.yesterdayCount}}</text>
								</view>

							</view>


						</view>
						<!-- 下部分 -->
					</view>
					<!-- 左边部分 -->


					<!-- 右边部分 -->

					<view class="contentCenterRight">

						<view class="contentCenterRightTop">

							<view class="contentCenterRightTopLeft" @click="scanClick()">
								<text class="contentCenterRightTopLeftText">扫一扫</text>
								<text class="contentCenterRightTopLeftTextValue">加入工厂登记收入</text>
							</view>

							<view class="contentCenterRightTopRight">
								<image class="contentCenterRightTopRightImg" src="/static/index/saoyisao.png" mode="">
								</image>
							</view>
						</view>
						<view class="contentCenterRightTop" @click="gokqUrl()">

							<view class="contentCenterRightTopLeft">
								<text class="contentCenterRightTopLeftText">考勤打卡</text>
								<text class="contentCenterRightTopLeftTextValue">记录统计考勤</text>
							</view>

							<view class="contentCenterRightTopRight">
								<image class="contentCenterRightTopRightImg" src="/static/index/kaoqin_daka.png"
									mode="">
								</image>
							</view>
						</view>
					</view>


					<!-- 右边部分 -->
				</view>
				<!-- 中间部分 -->


				<!-- 中间部分  userInfo.userType=='01' 表示老板 userType = 01老板  02 员工 -->
				<view class="contentCenter" v-if="userInfo.userType=='02'">




					<!-- 右边部分 -->

					<view class="contentCenterRightNew">

						<view class="contentCenterRightTop">

							<view class="contentCenterRightTopLeft" @click="scanClick()">
								<text class="contentCenterRightTopLeftText">扫一扫</text>
								<text class="contentCenterRightTopLeftTextValue">加入工厂登记收入</text>
							</view>

							<view class="contentCenterRightTopRight">
								<image class="contentCenterRightTopRightImg" src="/static/index/saoyisao.png" mode="">
								</image>
							</view>
						</view>
						<view class="contentCenterRightTop" @click="gokqUrl()">

							<view class="contentCenterRightTopLeft" @click="scanCode">
								<text class="contentCenterRightTopLeftText">考勤打卡</text>
								<text class="contentCenterRightTopLeftTextValue">记录统计考勤</text>
							</view>

							<view class="contentCenterRightTopRight">
								<image class="contentCenterRightTopRightImg" src="/static/index/kaoqin_daka.png"
									mode="">
								</image>
							</view>
						</view>
					</view>


					<!-- 右边部分 -->
				</view>
				<!-- 中间部分 -->


				<!--				<view class="contentBottom" v-if="userInfo.userType=='01'">-->

				<!-- 数据统计开始 -->
				<!--					<view class="contentBottomTitleContent">
						<text class="contentBottomTitleContentBg"></text>
						<text class="contentBottomTitleContentText">数据统计</text>
					</view>-->
				<!-- 数据统计结束 -->

				<!-- 日月年开始 -->
				<!--					<view class="contentDate">
						<view class="contentDateItem" @click="selectDate(1)">
							<image v-if="isSelect==1" src="../../static/index/xuanzhong.png" class="contentDateItemImg"
								mode=""></image>
							<text v-if="isSelect==1" class="contentDateItemText">日</text>
							<text v-if="isSelect!=1" class="contentDateItemText1">日</text>
						</view>
						<view class="contentDateItem" @click="selectDate(2)">
							<image v-if="isSelect==2" src="../../static/index/xuanzhong.png" class="contentDateItemImg"
								mode=""></image>
							<text v-if="isSelect==2" class="contentDateItemText">月</text>
							<text v-if="isSelect!=2" class="contentDateItemText1">月</text>
						</view>
						<view class="contentDateItem" @click="selectDate(3)">
							<image v-if="isSelect==3" src="../../static/index/xuanzhong.png" class="contentDateItemImg"
								mode=""></image>
							<text v-if="isSelect==3" class="contentDateItemText">年</text>
							<text v-if="isSelect!=3" class="contentDateItemText1">年</text>
						</view>
					</view>-->
				<!-- 日月年结束 -->

				<!-- 混合图开始 -->
				<!--					<view class="charts-box">
						<qiun-data-charts :ontouch="true" type="mix" :opts="opts" :chartData="chartData" />
					</view>-->
				<!-- 混合图结束 -->

				<!--				</view>-->



				<!-- 常用功能开始 -->
				<view class="baseInfo" v-if="baseInfoTitleShow">
					<view class="baseInfoText">
						<text class="baseImg"></text>
						<text class="baseText">{{baseInfoTitle}}</text>
					</view>
					<view class="baseList">
						<view class="baseListItem" v-for="(item,index) in baseList" @click="baseListOnClick(item)">
							<view class="baseListItemOut" :style="{background: item.color}">

							</view>
							<image class="baseListItemImg" :src="item.icon" mode=""></image>

							<text class="baseListItemText">{{item.title}}</text>
						</view>
					</view>
				</view>
				<!-- 常用功能结束 -->

			</view>
		</scroll-view>

	</view>
</template>

<script>
	import MyNav from '@/components/customnavbar.vue'
	import bgImage from '@/components/backgroundImage.vue'
	import {
		getInfo,
		getStoreList,
		salaryIndex,
		orderIndex,
		updateUserByStoreId,
		getPieceTotal
	} from '@/pages/api/api.js'


	export default {
		components: {
			MyNav,
			bgImage
		},
		data() {
			return {

				baseList: [
					//   {
					// 	title: '扫码报工',
					// 	icon: '../../static/gongzuotai/saoma_baogong.png',
					// 	color: '#0081FF'
					// },
					// {
					// 	title: '手工报工',
					// 	icon: '../../static/gongzuotai/shougong_baogong.png',
					// 	color: '#6BAFB1'
					// },
					{
						title: '订单生产情况',
						icon: '../../static/gongzuotai/dingdan_shengchan.png',
						color: '#0081FF'
					},
					{
						title: '员工薪资',
						icon: '../../static/gongzuotai/yuangong_xinzi.png',
						color: '#FA730A'
					}


				],
				baseInfoTitle: '常用功能',

				baseInfoTitleShow: true,

				// 图表选择 年月日 默认选中日
				isSelect: 1,
				titleColor: '#FFFFFF',


				login: '确定发送',

				title: '好好用(制衣版)',
				storeName: '',
				StoreList: [],
				isback: false,


				chartData: {},
				//您可以通过修改 config-ucharts.js 文件中下标为 ['mix'] 的节点来配置全局默认参数，如都是默认参数，此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式，达到页面简洁的需求。
				opts: {
					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: [15, 15, 0, 15],
					enableScroll: true,
					legend: {},
					dataLabel: false, //是否显示图表区域内数据点上方的数据文案
					xAxis: {
						disableGrid: true,
						// title: "单位：年",
						itemCount: 6, //单屏数据密度即图表可视区域内显示的X轴数据点数量，仅在启用enableScroll时有效
						scrollShow: false, //是否显示滚动条，配合拖拽滚动使用（即仅在启用【基本配置】的 enableScroll 时有效）
					},
					yAxis: {
						disabled: false,
						disableGrid: false,
						splitNumber: 5,
						gridType: "dash",
						dashLength: 4,
						gridColor: "#CCCCCC",
						padding: 10,
						showTitle: true,
						data: [{
								position: "left",
								// title: "折线"
								title: ""
							},
							{
								position: "right",

								// title: "柱状图",
								title: "",
								textAlign: "left"
							}
						]
					},
					extra: {
						mix: {
							column: {
								// 柱状体宽度
								width: 4,
								seriesGap: 10
							}
						}
					}
				},


				// 滚动高度
				scrollViewHeight: 0,

				mainTop: 0,



				data: {
					customCode: '18922405470',
					merchantCode: '4444',

				},


				user: {
					storeId: '',
					tenantId: '',

				},

				userInfo: {},
				userSalary: {},
				orderInfo: {},

			}
		},


		onReady() {

			this.getServerData();

			uni.showLoading({
				title: '加载中'
			});

			setTimeout(function() {
				uni.hideLoading();
			}, 2000);

			// 获取距离顶部的距离
			let query = uni.createSelectorQuery().in(this);
			query.select('#main').boundingClientRect(data => {
				// console.log(data);
				this.mainTop = data.top

				// 在其他页面或组件中访问
				const app = getApp();
				this.scrollViewHeight = app.globalData.system.screenHeight - this.mainTop - app.globalData
					.totalHeight - 50


				/* console.log('获取距离',this.mainTop,this.scrollViewHeight);
				console.log('滚动距离',this.scrollViewHeight); */
			}).exec();

		},

		onLoad() {

		},
		onShow() {
			this.getInfo()
		},
		methods: {

			// 基础信息 点击事件
			baseListOnClick(e) {
				console.log("基础信息点击事件", e.title);


				switch (e.title) {
					case '工序模版':
						uni.navigateTo({
							url: '/subPack/process/processTemplate/processTemplate',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '工序管理':
						uni.navigateTo({
							url: '/subPack/processmanagement/ProcessManagement/ProcessManagement',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});

						break;

					case '尺码管理':
						uni.navigateTo({
							url: '/subPack/sizeManagement/sizeManagement/sizeManagement',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '颜色分组':
						uni.navigateTo({
							url: '/pages/colorGroup/colorGroup/colorGroup',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '颜色管理':
						uni.navigateTo({
							url: '/subPackA/colorManagement/colorManagement/colorManagement',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '尺码组':
						uni.navigateTo({
							url: '/subPack/sizeGroup/sizeGroup/sizeGroup',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '部门管理':
						uni.navigateTo({
							url: '/subPack/departmentManagement/departmentManagement/departmentManagement',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '员工管理':
						uni.navigateTo({
							url: '/subPack/employeeManagement/employeeManagement/employeeManagement',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '款式管理':
						uni.navigateTo({
							url: '/subPack/styleManagement/styleManagement/styleManagement',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						/*uni.navigateTo({
							url: '/subPack/styleManagementNewSelect/styleManagementNewSelect',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});*/
						break;

					case '裁床订单':
						uni.navigateTo({
							url: '/subPackA/cuttingOrder/cuttingOrder/cuttingOrder',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break;

					case '打印菲票':
						uni.navigateTo({
							url: '/subPack/printedTicket/printedTicket/printedTicket',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break


					case '扫码报工':
						uni.navigateTo({
							url: '/subPack/workInThePhilippines/workInThePhilippines/workInThePhilippines',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break


					case '手工报工':
						uni.navigateTo({
							url: '/subPack/workInThePhilippines/reportTheWorkToThePhilippines/reportTheWorkToThePhilippines',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});

					case '删除菲':
						uni.navigateTo({
							url: '/subPack/workInThePhilippines/scanTheCode/scanCodeList',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});

					case '添加打印机':
						uni.navigateTo({
							url: '/subPack/printerSetup/addPrinter/addPrinter',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break
					case '打印机列表':
						uni.navigateTo({
							url: '/subPack/printerSetup/printerList/printerList',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break

					case '发送到打印机':
						uni.navigateTo({
							url: '/subPack/sendToPrinter/sendToPrinter/sendToPrinter',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break

					case '订单生产情况':
						uni.navigateTo({
							url: '/pages/orderList/orderList/orderList',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break
					case '员工薪资':
						uni.navigateTo({
							url: '/pages/employeeSalary/employeeSalary/employeeSalary',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break

					case '打卡':
						uni.navigateTo({
							url: '/subPack/clockIn/clockInNew/clockInNew',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break

					case '补卡':
						uni.navigateTo({
							url: '/subPack/replacementCard/replacementCardDetail/replacementCardDetail',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break

					case '请假申请':
						uni.navigateTo({
							url: '/subPack/askForLeave/askForLeave/askForLeave',
							success: res => {},
							fail: () => {},
							complete: () => {}
						});
						break


					default:
						break;

				}


			},
			// 扫一扫
			scanClick() {

				uni.navigateTo({
					url: '/subPack/workInThePhilippines/scanTheCode/scanTheCode',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			// 工厂选择
			chooseHobby(e) {
				// console.log(e);
				let key = e.detail.value
				if (this.storeName == this.StoreList[key].name) {
					return false;
				}
				this.storeName = this.StoreList[key].name
				let storeId = this.StoreList[key].id
				let data = {
					storeId: storeId,
					userId: this.userInfo.userId
				}
				updateUserByStoreId(data).then(res => {
					if (res.code == 200) {
						this.getInfo();
					}
				})
				// console.log("工厂", this.storeName,this.StoreList, e)
			},

			// 获取用户信息
			getInfo() {

				getInfo().then((res) => {
					if (res.code == 200) {
						this.user.storeId = res.user.storeId
						this.user.tenantId = res.user.tenantId
						this.storeName = res.store.name
						this.userInfo = res.user
						// console.log('用户数据',res,res.user.storeId);
						// 保存userInfo 用户信息
						uni.setStorageSync('userInfo', res.user)
						uni.setStorageSync("store", res.store)
						uni.setStorageSync("roles", res.roles)
						uni.setStorageSync("permissions", res.permissions)
						uni.setStorageSync("storeId", res.user.storeId)
						uni.setStorageSync("tenantId", res.user.tenantId)
						const app = getApp();
						app.globalData.storeId = res.user.storeId
						app.globalData.tenantId = res.user.tenantId
						// console.log('用户数据',res,res.user.storeId,uni.getStorageSync('storeId'));
						this.getStoreList(res.user.storeId, res.user.tenantId);
						if (this.userInfo.userType == '01') {
							this.getPieceTotal()
						} else if (this.userInfo.userType == '02') {
							this.getSalaryIndex()
						}
						this.getOrderIndex()
					} else {
						// 提示错误信息
						uni.showToast({
							title: res.msg,
							icon: 'none'
						});
					}


				}).catch((err) => {
					// console.error('11获取数据失败', err);
					uni.showToast({
						title: err.msg
					});
				});
			},
			getPieceTotal() {
				let data = {
					userId: this.userInfo.userId,
					storeId: this.userInfo.storeId,
					tenantId: this.userInfo.tenantId
				}
				getPieceTotal(data).then(res => {
					if (res.code == 200) {
						this.userSalary = res.data
					}
				})
			},
			getSalaryIndex() {
				let data = {
					userId: this.userInfo.userId,
					storeId: this.userInfo.storeId,
					tenantId: this.userInfo.tenantId
				}
				salaryIndex(data).then(res => {
					if (res.code == 200) {
						this.userSalary = res.data
					}
				})
			},
			getStoreList(storeId, tenantId) {
				let data = {
					tenantId: tenantId
				}
				getStoreList(data).then((res) => {
					if (res.code == 200) {
						this.StoreList = res.data
						console.log('工厂数据', res);
						// this.storeName = this.storeList.findIndex(item=>{
						//   if(item.id === storeId){
						//     return item.name
						//   }
						// })
					}
				})
			},
			selectDate(e) {
				this.isSelect = e;
				console.log('选择了', this.isSelect);
				this.getServerData()
			},

			/*gokqUrl() {
				uni.navigateTo({
					url: '/subPack/clockIn/clockInNew/clockInNew',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			scanCode() {
				uni.scanCode({
					success: function(res) {
						console.log('条码被扫描结果', res);
						if (res.result) {
							uni.showToast({
								title: '扫描成功',
								icon: 'success'
							});
							// 处理扫描结果，例如跳转到某个页面或者显示扫描结果
							uni.navigateTo({
								url: '/subPack/workInThePhilippines/workInThePhilippines/workInThePhilippines?code=' +
									res.result
							});
						} else {
							uni.showToast({
								title: '未检测到有效条码',
								icon: 'none'
							});
						}
					}
				});
			},*/
			/*salaryUrl() {
				let data = {
					userName: this.userInfo.userName,
					userId: this.userInfo.userId,
					monthStart: this.getFirstDayOfMonth,
					monthEnd: this.getLastDayOfMonth
				}
				uni.navigateTo({
					url: '/subPack/workInThePhilippines/reportWorkResult/reportWorkResult?data=' +
						encodeURIComponent(JSON.stringify(data)),
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			getFirstDayOfMonth(year, month) {
				return new Date(year, month, 1);
			},
			getLastDayOfMonth(year, month) {
				return new Date(year, month + 1, 0); // 月份是从0开始的，所以实际月份需要+1，然后日期设为0表示上个月的最后一天
			},*/
			// 跳转二维码
			qrCode() {

				uni.navigateTo({
					url: '/subPackA/showQrcode/showQrcode?storeName=' + this.storeName,
					success: res => {},
					fail: () => {
						console.log('跳转二维码失败');
					},
					complete: () => {}
				});

			},

			gokqUrl() {
				uni.navigateTo({
					url: '/subPack/clockIn/clockInNew/clockInNew',
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			goWaitUrl() {
				let data = {
					status: '1'
				}
				uni.navigateTo({
					url: '/pages/orderList/orderList/orderList?item=' + encodeURIComponent(JSON.stringify(data)),
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			salaryUrl() {
				let data = {
					userName: this.userInfo.userName,
					userId: this.userInfo.userId,
					monthStart: this.getFirstDayOfMonth(),
					monthEnd: this.getLastDayOfMonth()
				}
				console.log('data', data)
				uni.navigateTo({
					url: '/pages/employeeSalary/employeeSalary/employeeSalaryDetail?data=' + encodeURIComponent(
						JSON.stringify(data)),
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			},
			getFirstDayOfMonth() {
				let date = new Date();
				date.setDate(1);
				return date.toISOString().slice(0, 10);
			},
			getLastDayOfMonth() {
				let date = new Date();
				date.setDate(1);
				return new Date().toISOString().slice(0, 10);
			},
			getOrderIndex() {
				let data = {
					storeId: this.userInfo.storeId,
					tenantId: this.userInfo.tenantId
				}
				orderIndex(data).then(res => {
					if (res.code == 200) {
						this.orderInfo = res.data
					}
				})
			},

			// 点击消息
			noticeClick() {
				uni.navigateTo({
					url: '/pages/notification/notification/notification',
					success: res => {},
					fail: () => {
						console.log('跳转信息失败');
					},
					complete: () => {}
				});
			},
			getServerData() {
				//模拟从服务器获取数据时的延时
				setTimeout(() => {
					//模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
					let res = {
						// categories: ["2018","2019","2020","2021","2022","2023","2018","2019","2020","2021","2022","2023"],
						categories: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月",
							"12月"
						],
						series: [

							{
								name: "完成工单数",
								index: 1,
								type: "column",
								// data: [40,{"value":30,"color":"#f04864"},55,110,24,58,40,{"value":30,"color":"#f04864"},55,110,24,58],
								data: [40, 30, 55, 110, 24, 58, 40, 30, 55, 110, 24, 58]
							},


							{
								// name: "折线",
								name: "收入金额",
								type: "line",
								color: "#FF6A00",
								data: [120, 140, 105, 170, 95, 160, 120, 140, 105, 170, 95, 160]
							}

						]
					};
					this.chartData = JSON.parse(JSON.stringify(res));
				}, 500);
			}

		}
	}
</script>

<style lang="scss">
	.baseListItemText {

		font-size: 24rpx;
		color: #333333;
		line-height: 100rpx;
		text-align: center;
		font-style: normal;
		text-transform: none;
		font-weight: 600;

	}

	.baseListItemOut {

		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;

		width: 80rpx;
		height: 80rpx;

		border-radius: 20rpx;

		opacity: 0.08;



	}

	.baseListItemImg {
		width: 44rpx;
		height: 44rpx;
		margin-top: -62rpx;

	}

	.baseListItem {
		display: flex;
		flex-direction: column;
		align-items: center;


		flex: 0 0 calc((100%)/4);

	}

	.baseList {
		display: flex;
		flex-direction: row;
		width: 100%;
		flex-wrap: wrap;
		margin-top: 29rpx;
	}

	.baseText {
		font-family: HarmonyOS_Sans_SC_Bold;
		font-size: 28rpx;
		color: #333333;
		margin-left: 20rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
		font-weight: 600;
		height: 26rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.baseImg {
		width: 8rpx;
		height: 26rpx;
		background: #0081FF;
		border-radius: 2rpx 2rpx 2rpx 2rpx;
		margin-left: 30rpx;

	}

	.baseInfoText {
		display: flex;
		flex-direction: row;
		align-items: left;
		margin-top: 30rpx;
		width: 100%;

	}

	.baseInfo {
		margin-top: 30rpx;
		display: flex;

		flex-direction: column;
		width: 690rpx;

		background: #FFFFFF;
		border-radius: 30rpx 30rpx 30rpx 30rpx;
	}


	.imagepage {

		background-size: cover;
		background-repeat: no-repeat;
		background-position: center center;
		position: absolute;
		z-index: -1;
		left: 0;
		right: 0;
		bottom: 0;
		right: 0;
		width: 100%;
		height: 100%;

	}

	.ContentInner {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
	}

	.Content {
		display: flex;
		justify-content: center;
		align-items: center;


	}

	.contentDateItem {
		display: flex;
		position: relative;
		justify-content: center;

		align-items: center;
		width: 80rpx;
		height: 57rpx;
		margin-left: 30rpx;


		.contentDateItemImg {
			width: 100%;
			height: 100%;

		}

		.contentDateItemText {
			font-family: HarmonyOS Sans SC;
			font-weight: 400;
			font-size: 24rpx;
			color: #FFFFFF;
			line-height: 48rpx;

			display: flex;

			position: absolute;
			top: 0;

			/* width: 80rpx;
			height: 50rpx;
			background: #ECF5FD;
			border-radius: 16rpx; */


		}

		.contentDateItemText1 {
			font-family: HarmonyOS Sans SC;
			font-weight: 400;
			font-size: 24rpx;
			color: black;
			line-height: 48rpx;

			display: flex;

			justify-content: center;
			align-items: center;

			width: 80rpx;
			height: 50rpx;
			background: #ECF5FD;
			border-radius: 16rpx;


		}
	}

	.contentDate {
		display: flex;
		width: 100%;
	}

	.contentBottomTitleContentText {
		display: flex;
		font-family: HarmonyOS Sans SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #333333;
		line-height: 82rpx;
	}

	.contentBottomTitleContentBg {
		width: 4rpx;
		height: 26rpx;
		background: #0081FF;
		border-radius: 2rpx;
		margin-left: 30rpx;
		margin-right: 15rpx;
	}

	.contentBottomTitleContent {

		display: flex;
		align-items: center;
		width: 100%;

	}

	.charts-box {
		width: 100%;
		height: 500rpx;
		margin-bottom: 30rpx;
	}

	.contentBottom {
		width: 690rpx;

		background: #FFFFFF;
		border-radius: 30rpx;
		margin-bottom: 30rpx;
	}

	.contentCenterRightTopRightImg {
		display: flex;

		width: 70rpx;
		height: 70rpx;
	}

	.contentCenterRightTopRight {
		display: flex;
		margin-right: 30rpx;

	}

	.contentCenterRightTopLeftTextValue {
		display: flex;

		font-family: HarmonyOS Sans SC;
		font-weight: 400;
		font-size: 20rpx;
		color: #999999;
		margin-top: 14rpx;
	}

	.contentCenterRightTopLeftText {
		display: flex;

		font-family: HarmonyOS Sans SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #333333;

	}

	.contentCenterRightTopLeft {

		display: flex;
		flex-direction: column;
		margin-left: 30rpx;

	}

	.contentCenterRightTop {

		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 330rpx;
		height: 150rpx;
		background: #FFFFFF;
		border-radius: 30rpx;
		margin-bottom: 30rpx;
	}

	.contentCenterRight {
		display: flex;

		justify-content: center;
		align-items: center;
		flex-direction: column;
		margin-right: 30rpx;
		margin-top: 30rpx;
	}

	.contentCenterRightNew {
		display: flex;
		width: 100%;
		justify-content: space-around;
		align-items: center;
		flex-direction: row;

		margin-top: 30rpx;
	}

	.contentCenterLeftBottomTop {
		display: flex;
		width: 100%;
		justify-content: left;

	}

	.contentCenterLeftBottomTopText {
		display: flex;
		font-family: HarmonyOS Sans SC;
		font-weight: bold;
		font-size: 24rpx;
		color: #333333;
		line-height: 36rpx;
		margin-left: 30rpx;
	}

	.contentCenterLeftBottomBottomBottomText {
		display: flex;

		font-family: HarmonyOS Sans SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #333333;
		line-height: 36rpx;

		width: 100%;
		justify-content: flex-start;

	}

	.contentCenterLeftBottomBottomBottom {

		display: flex;
		width: 100%;
		justify-content: space-evenly;
		align-items: center;
		margin-top: 10rpx;
	}

	.contentCenterLeftBottomBottomTopText {
		display: flex;
		font-family: HarmonyOS Sans SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		line-height: 36rpx;

		width: 100%;
		justify-content: flex-start;


	}

	.contentCenterLeftBottomBottomTop {
		display: flex;
		width: 100%;
		justify-content: space-evenly;
		align-items: center;
	}

	.contentCenterLeftBottomBottom {
		display: flex;
		flex-direction: column;
		align-items: center;

		width: 100%;
		margin-top: 20rpx;
		padding-left: 50rpx;
	}

	.contentCenterLeftBottom {

		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 310rpx;
		height: 155rpx;
		background: #F3F5F9;
		border-radius: 20rpx;

		margin-top: 30rpx;
	}

	.contentCenterLeftTopRightImg {
		display: flex;

		width: 101rpx;
		height: 86rpx;

	}

	.contentCenterLeftTopRight {
		display: flex;
		margin-right: 30rpx;
	}

	.contentCenterLeftTopLeftTextValue {
		display: flex;
		justify-content: flex-start;
		font-family: HarmonyOS Sans SC;
		font-weight: 500;
		font-size: 60rpx;
		color: #FF4E00;
		line-height: 36rpx;
		width: 100%;
	}

	.contentCenterLeftTopLeftText {
		display: flex;
		font-family: HarmonyOS Sans SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #333333;
		line-height: 100rpx;
		width: 100%;
	}

	.contentCenterLeftTopLeft {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: left;
		margin-left: 30rpx;

	}

	.contentCenterLeftTop {

		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
	}

	.contentCenterLeft {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		width: 330rpx;
		height: 330rpx;
		background: #FFFFFF;
		border-radius: 30rpx;
		margin-left: 30rpx;
	}

	.contentCenter {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;

	}

	.contentTopDownBottomText {

		display: flex;
		justify-content: flex-start;
		align-items: center;
		text-align: center;
		font-family: HarmonyOS Sans SC;
		font-weight: bold;
		font-size: 28rpx;
		color: #333333;
		width: 33.33%;
		line-height: 36rpx;

	}

	.contentTopDownBottom {

		display: flex;
		justify-content: space-evenly;
		align-items: center;
		width: 100%;
		margin-top: 10rpx;
	}

	.contentTopDownTopText {

		font-family: HarmonyOS Sans SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		line-height: 36rpx;
		width: 33.33%;
		text-align: center;
		display: flex;
		justify-content: flex-start;
		align-items: center;
	}

	.contentTopDownTop {
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		width: 100%;

	}

	.contentTopDown {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		width: 670rpx;
		height: 124rpx;
		background: #F3F5F9;
		border-radius: 20rpx;
		margin-top: 50rpx;

		margin-bottom: 10rpx;
	}


	.contentTopInfoRightImg {

		width: 10rpx;
		height: 16rpx;
		margin-left: 20rpx;
	}

	.contentTopInfoRightText {
		display: flex;
		font-family: HarmonyOS Sans SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		line-height: 36rpx;
	}

	.contentTopInfoRight {
		display: flex;

		justify-content: center;
		align-items: center;
		margin-right: 30rpx;
		z-index: 1;

	}

	.contentTopInfoTopLeftBottom {
		display: flex;

		font-family: HarmonyOS Sans SC;
		font-weight: 500;
		font-size: 60rpx;
		color: #0081FF;
		line-height: 36rpx;
		margin-top: 18rpx;
	}

	.contentTopInfoTopLeftTopImg {
		width: 26rpx;
		height: 18rpx;
		margin-left: 20rpx;
	}

	.contentTopInfoTopLeftTopText {
		display: flex;
		font-family: HarmonyOS Sans SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		line-height: 36rpx;
	}

	.contentTopInfoTopLeftTop {
		display: flex;
		justify-content: center;
		align-items: center;


	}

	.contentTopInfoTopLeft {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		margin-left: 30rpx;
		z-index: 1;
	}

	.contentTopInfoTop {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		padding-top: 30rpx;


	}

	.contentTopInfoTopImgBg {
		display: flex;
		justify-content: flex-start;
		position: absolute;
		top: 10; 
		width: 688rpx;
		height: 199rpx;
		z-index: 0;
	}

	.contentTopInfo {
		display: flex;
		align-items: center;
		flex-direction: column;

		width: 686rpx;
		height: 296rpx;
		background: #FFFFFF;
		border-radius: 28rpx;

		margin-top: 30rpx;
	}

	.contentTopRightLeft {

		width: 60rpx;
		height: 60rpx;
		background: #FFFFFF;
		// background: #ECF5FD;
		border-radius: 16rpx;

		margin-left: 30rpx;

		display: flex;
		justify-content: center;
		align-items: center;

		background-color: rgba(0, 0, 0, 0.05);
		/* 背景透明度为 50% */







	}

	.contentTopRightLeftImg {

		width: 33rpx;
		height: 33rpx;





	}

	.contentTopRight {
		display: flex;
		margin-right: 20rpx;
	}

	.infoArrow {
		height: 10rpx;
		width: 20rpx;
		margin-left: 20rpx;
		background-color: greenyellow;
	}

	.contentTopLeftText {

		font-family: HarmonyOS Sans SC;
		font-weight: 400;
		font-size: 28rpx;
		color: #FFF;

		display: flex;
		margin-left: 30rpx;
		// background-color: #8f8f94;
	}

	.contentTopLeft {
		display: flex;
		justify-content: center;
		align-items: center;
		//background-color: black;
		margin-left: 20rpx;
	}

	.contentTop {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;

		position: relative;
	}



	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>